Run rustfmt, add missing RcVecIter code
authorPhlosioneer <mattmdrr2@gmail.com>
Sun, 1 Apr 2018 19:07:50 +0000 (15:07 -0400)
committerPhlosioneer <mattmdrr2@gmail.com>
Sun, 1 Apr 2018 19:07:50 +0000 (15:07 -0400)
src/cargo/core/resolver/types.rs somehow wasn't added to the
previous commit.

src/cargo/core/resolver/resolve.rs
src/cargo/core/resolver/types.rs
src/cargo/core/workspace.rs

index 73d30b1595bb6eb092dac8a44037918aa9914520..48f1aebe40d607ce94d05a81ef9a0706febd850c 100644 (file)
@@ -4,8 +4,8 @@ use std::iter::FromIterator;
 
 use url::Url;
 
-use core::{PackageId, Summary};
 use core::PackageIdSpec;
+use core::{PackageId, Summary};
 use util::Graph;
 use util::errors::CargoResult;
 use util::graph::{Edges, Nodes};
@@ -209,7 +209,7 @@ impl<'a> Iterator for Deps<'a> {
             // Note: Edges is actually a std::collections::hash_set::Iter, which
             // is an ExactSizeIterator.
             Some(ref iter) => iter.size_hint(),
-            None => (0, Some(0))
+            None => (0, Some(0)),
         }
     }
 }
@@ -232,7 +232,7 @@ impl<'a> Iterator for DepsNotReplaced<'a> {
             // Note: Edges is actually a std::collections::hash_set::Iter, which
             // is an ExactSizeIterator.
             Some(ref iter) => iter.size_hint(),
-            None => (0, Some(0))
+            None => (0, Some(0)),
         }
     }
 }
index c21822b7b323c659202017a7f954fa30d33d4db7..d0b8c9d963b45b4306c7ef329c5e5c3f3d25b890 100644 (file)
@@ -342,10 +342,13 @@ where
     }
 
     fn size_hint(&self) -> (usize, Option<usize>) {
+        // rest is a std::ops::Range, which is an ExactSizeIterator.
         self.rest.size_hint()
     }
 }
 
+impl<T> ExactSizeIterator for RcVecIter<T> {}
+
 pub struct RcList<T> {
     pub head: Option<Rc<(T, RcList<T>)>>,
 }
index 0c20f63e65e5d6d00cc7928e607af0a4bb16ea24..b99587741b433396eb2d6ba11922eeeb0cc26e3f 100644 (file)
@@ -8,8 +8,8 @@ use glob::glob;
 use url::Url;
 
 use core::registry::PackageRegistry;
-use core::{EitherManifest, Package, SourceId, VirtualManifest};
 use core::{Dependency, PackageIdSpec, Profile, Profiles};
+use core::{EitherManifest, Package, SourceId, VirtualManifest};
 use ops;
 use sources::PathSource;
 use util::errors::{CargoResult, CargoResultExt};